<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: 'app',
  created () {
    this.$store.replaceState(Object.assign(this.$store.state,JSON.parse(sessionStorage.getItem("beforeunload"))));
    window.addEventListener('beforeunload', ()=>{
      let state = JSON.stringify(this.$store.state)
      sessionStorage.setItem("beforeunload",state)
    })
  }
}
</script>

<style lang="scss">
#app {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: $font-family-base;
  font-size: $font-size-base;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-weight: $font-weight-base;
  color: $color-primary;
  user-select: none;
}
@media screen and (min-width: 1000px) {
  #app {
    min-width: 1280px;
    min-height: 768px;
  }
}
</style>
